package org.akomantoso.core.data;

import java.io.IOException;

import org.akomantoso.core.io.Output;
import org.akomantoso.core.visitor.AKVisitor;

/**
 * the element componentRef is a manifestation-level reference to a separate resource that holds the content of the
 * component of the document not physically placed at the position specified. Actual resources can either be external
 * (e.g. in the package or even in a different position) or internal (within the components element)
 * 
 * <pre>
 * 	<xsd:element name="componentRef" type="srcType"/>
 * </pre>
 * 
 * @author <a href="mailto:jacques.militello@gmail.com">Jacques Militello</a>
 * 
 * @since http://www.akomantoso.org/1.0
 * 
 */
public final class ComponentRef extends SrcType implements CollectionBodyElement, MainContentElement,
		AltHierarchyElement, BodyTypeElement, HierarchyElement {

	public static final String ELEMENT = "componentRef";

	/**
	 * @see org.akomantoso.core.data.Basicopt#writeExternal(org.akomantoso.core.io.Output)
	 */
	@Override
	public <T extends Output> void writeExternal(T out) throws IOException {
		out.writeStart(ELEMENT);
		super.writeExternal(out);
		out.writeEnd();
	}

	/**
	 * @see ec.ep.visitor.AKVisitable#accept(ec.ep.visitor.AKVisitor)
	 */
	public void accept(AKVisitor visitor) {
		visitor.visit(this);
	}

}